import 'dart:convert';

class MeMenus {
  List<MenuItemA> doctor;
  List<MenuItemA> assistant;
  List<MenuItemA> patient;
  List<MenuItemA> admin;

  MeMenus(this.doctor, this.assistant, this.patient, this.admin);

  factory MeMenus.fromJson(Map<String, dynamic> data) {
    return MeMenus(
      (data["doctor"] as List).map((e) => MenuItemA.fromJson(e)).toList(),
      (data["assistant"] as List).map((e) => MenuItemA.fromJson(e)).toList(),
      (data["patient"] as List).map((e) => MenuItemA.fromJson(e)).toList(),
      (data["admin"] as List).map((e) => MenuItemA.fromJson(e)).toList(),
    );
  }

  Map<String, List<MenuItemA>> toJson() {
    return {
      "doctor": doctor,
      "assistant": assistant,
      "patient": patient,
      "admin": admin,
    };
  }

  @override
  String toString() {
    return json.encode(toJson());
  }
}

class MenuItemA {
  String id, imgTarget, imgResUrl, btnText;

  MenuItemA(this.id, this.imgTarget, this.imgResUrl, this.btnText);

  factory MenuItemA.fromJson(Map<String, dynamic> data) {
    return MenuItemA(
      data["id"],
      data["imgTarget"],
      data["imgResUrl"],
      data["btnText"],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      "id": id,
      "imgTarget": imgTarget,
      "imgResUrl": imgResUrl,
      "btnText": btnText,
    };
  }

  @override
  String toString() {
    return json.encode(toJson());
  }
}
